﻿# -*- coding: utf-8 -*-
"""
Created on Sat Aug  3 20:14:30 2019
project name:love
@author: 帅帅de三叔
"""
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D #3d绘图模块
import numpy as np #导入数值计算拓展模块

#start generating points
x_lim=np.linspace(-10,10,520)
y_lim=np.linspace(-10,10,520)
z_lim=np.linspace(-10,10,520)
X_points=[] #用来存放绘图点X坐标
Y_points=[] #用来存放绘图点Y坐标
Z_points=[] #用来存放绘图点Z坐标
for x in x_lim:
    for y in y_lim:
        for z in z_lim:
            if (x**2+(9/4)*y**2+z**2-1)**3-(9/80)*y**2*z**3-x**2*z**3<=0:
                X_points.append(x)
                Y_points.append(y)
                Z_points.append(z)

###start plot love
fig=plt.figure() #画布初始化
ax=fig.add_subplot(111,projection='3d') #采用3d绘图
ax.scatter(X_points,Y_points,Z_points,s=20,alpha=0.5,color="red") #3d散点图填充
plt.show()

"""
————————————————
版权声明：本文为CSDN博主「三行科创」的原创文章，遵循 CC 4.0 BY-SA 版权协议，转载请附上原文出处链接及本声明。
原文链接：https://blog.csdn.net/zengbowengood/article/details/98658842
"""